package ystp.model;

import lombok.Data;

import java.lang.reflect.Field;
import java.util.Date;
import java.util.Objects;

@Data
public class Ty {
    private String id;

    private String xiangmuid;

    private String text1;

    private String text2;

    private String text3;

    private Integer ordernumber;

    private Integer isvote;

    private Date createtime;

    private String text4;

    private String text5;

    private String text6;

    private String text7;

    private String text8;

    private String text9;

    private String text10;

    private String text11;

    private String text12;

    private String text13;

    private String text14;

    private String text15;

    private String text16;

    private String text17;

    private String text18;

    private String text19;

    private String text20;
    private String text21;
    private String text22;
    private String text23;
    private String text24;
    private String text25;
    private String text26;

    private String result;
    private String piaoshu;

    public String getAttribute(String field) {
        String r = "";
        if (Objects.equals(field, "") || field == null)
            return null;
        try {
            Field f = this.getClass().getDeclaredField(field);
            f.setAccessible(true);
            r = f.get(this) == null ? "" : f.get(this).toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return r;
    }

    public void setAttribute(String field, Object keyWord) {
        try {
            Field f = this.getClass().getDeclaredField(field);
            f.setAccessible(true);
            f.set(this, keyWord);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public String toString() {
        return "Ty{" +
                "id='" + id + '\'' +
                ", xiangmuid='" + xiangmuid + '\'' +
                ", text1='" + text1 + '\'' +
                ", text2='" + text2 + '\'' +
                ", text3='" + text3 + '\'' +
                ", ordernumber=" + ordernumber +
                ", isvote=" + isvote +
                ", createtime=" + createtime +
                ", text4='" + text4 + '\'' +
                ", text5='" + text5 + '\'' +
                ", text6='" + text6 + '\'' +
                ", text7='" + text7 + '\'' +
                ", text8='" + text8 + '\'' +
                ", text9='" + text9 + '\'' +
                ", text10='" + text10 + '\'' +
                ", text11='" + text11 + '\'' +
                ", text12='" + text12 + '\'' +
                ", text13='" + text13 + '\'' +
                ", text14='" + text14 + '\'' +
                ", text15='" + text15 + '\'' +
                ", text16='" + text16 + '\'' +
                ", text17='" + text17 + '\'' +
                ", text18='" + text18 + '\'' +
                ", text19='" + text19 + '\'' +
                ", text20='" + text20 + '\'' +
                ", result='" + result + '\'' +
                ", piaoshu='" + piaoshu + '\'' +
                '}';
    }
    public Ty(){

    }
    public Ty(Ty item) {
        this.id = item.getId();
        this.xiangmuid = item.getXiangmuid();
        this.text1 = item.getText1();
        this.text2 = item.getText2();
        this.text3 = item.getText3();
        this.ordernumber = item.getOrdernumber();
        this.isvote = item.getIsvote();
        this.createtime = item.getCreatetime();
        this.text4 = item.getText4();
        this.text5 = item.getText5();
        this.text6 = item.getText6();
        this.text7 = item.getText7();
        this.text8 = item.getText8();
        this.text9 = item.getText9();
        this.text10 = item.getText10();
        this.text11 = item.getText11();
        this.text12 = item.getText12();
        this.text13 = item.getText13();
        this.text14 = item.getText14();
        this.text15 = item.getText15();
        this.text16 = item.getText16();
        this.text17 = item.getText17();
        this.text18 = item.getText18();
        this.text19 = item.getText19();
        this.text20 = item.getText20();
        this.text21 = item.getText21();
        this.text22 = item.getText22();
        this.text23 = item.getText23();
        this.text24 = item.getText24();
        this.text25 = item.getText25();
        this.text26 = item.getText26();
        this.result = item.getResult();
        this.piaoshu = item.getPiaoshu();
    }
}